import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { WebsiteTypes, WebsiteTypesDocument } from 'src/db/schemas/website-types.schema';
import {
  addOne
} from 'src/utils';
import { CreateWebsiteTypeDto } from './dto/create-website-types.dto';

@Injectable()
export class WebsiteTypesService {
  constructor(
    @InjectModel(WebsiteTypes.name) private websiteTypesModel: Model<WebsiteTypesDocument>,
  ) { }

  async addWebsiteType(createAndUpdateWebsiteTypeDto: CreateWebsiteTypeDto) {
    return addOne(this.websiteTypesModel, createAndUpdateWebsiteTypeDto);
  }
}
